package com.lethe.medical.action.sys;

import com.lethe.medical.base.BaseServlet;
import com.lethe.medical.base.annotation.MethodAnnotation;
import com.lethe.medical.entity.UserEntity;
import com.lethe.medical.service.MenuService;
import com.lethe.medical.service.UserService;
import com.lethe.medical.service.impl.MenuServiceImpl;
import com.lethe.medical.service.impl.UserServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

@WebServlet("/menu/*")
public class MenuServlet extends BaseServlet {
    private static final long serialVersionUID = 1L;

    private MenuService menuService = new MenuServiceImpl();

    @MethodAnnotation(method="list")
    public void list(HttpServletRequest request, HttpServletResponse response){
        try {
            response.getWriter().write("<script>alert('你调用了查询方法！......test')</script>");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @MethodAnnotation(method="add")
    public void add(HttpServletRequest request, HttpServletResponse response){
        try {
            response.getWriter().write("<script>alert('你调用了查询方法！......test')</script>");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @MethodAnnotation(method="update")
    public void update(HttpServletRequest request, HttpServletResponse response){
        try {
            response.getWriter().write("<script>alert('你调用了查询方法！......test')</script>");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @MethodAnnotation(method="delete")
    public void delete(HttpServletRequest request, HttpServletResponse response){
        try {
            response.getWriter().write("<script>alert('你调用了查询方法！......test')</script>");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


    @MethodAnnotation(method="assignAuth")
    public void assignAuth(HttpServletRequest request, HttpServletResponse response){
        try {
            response.getWriter().write("<script>alert('你调用了查询方法！......test')</script>");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @MethodAnnotation(method="assign")
    public void assign(HttpServletRequest request, HttpServletResponse response){
        try {
            response.getWriter().write("<script>alert('你调用了查询方法！......test')</script>");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


}
